<template>
  <view class="personal-nav">
    <!-- 顶部导航栏 -->
    <view class="header-container dark">
      <view class="nav-left" @click="navigateBack">
        <uni-icons type="left" size="20" color="#eee"></uni-icons>
      </view>
      <view class="nav-title">编辑资料</view>
      <view
        class="nav-right"
        @click="saveProfile"
        style="display: flex; align-items: center"
      >
        <!-- <text class="save-btn">保存</text> -->
        <button type="primary" size="mini">保存</button>
      </view>
    </view>
  </view>
</template>

<script>
  import { mePage } from "@/API/pageConst";

  export default {
    name: "PersonalNav",
    data() {
      return {};
    },
    methods: {
      navigateBack() {
        // uni.navigateBack({ delta: 1 });
        uni.switchTab({
          url: mePage,
        });
      },
      saveProfile() {
        this.$emit("saveProfile");
        // uni.showToast({
        //   title: "保存成功",
        //   icon: "none",
        //   duration: 1000,
        // });
      },
    },
  };
</script>

<style scoped>
  .personal-nav {
    width: 100%;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;
  }
  /* 导航栏样式 */
  .header-container {
    height: 35px;
    width: 100%;
    background-color: var(--o-bg-blue);
    color: #eee;
    margin: 10px 8px;
    padding: 0;
    box-sizing: content-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-title {
    font-size: 18px;
    font-weight: 500;
    color: #eee;
  }

  .save-btn {
    color: #eee;
    font-size: 16px;
  }
</style>
